/*
 * GeoReactor.h
 *
 *  Created on: 18 Oct 2011
 *      Author: allan
 */

#ifndef GEOREACTOR_H_
#define GEOREACTOR_H_

// GeoReact includes
#include <Core/KineticSolver.h>

// GeoReact forward declarations
class GeoSystem;

class GeoReactor
{
public:
	GeoReactor();
	
	GeoReactor(const CannonicalSystem& cannonical_system);
	
	void
	SetMinimumTimeStep(double dt_min);
	
	void
	SetMaximumTimeStep(double dt_max);
	
	void
	SetAlgorithm(const string& algorithm);
	
	void
	SetAdaptiveTimeStepControl(double eps_abs, double eps_rel);
	
	const double
	GetMinimumTimeStep() const;
	
	const double
	GetMaximumTimeStep() const;
	
	const string
	GetAlgorithm() const;
	
	const CannonicalSystem&
	GetCannonicalSystem() const;
	
	void
	TotalCompositionPrimarySpecies(const VectorXd& n, VectorXd& uj);
	
	void
	TotalEquilibrate(const VectorXd& ujnk, double T, double P, VectorXd& n);
	
	void
	ReactStep(KineticStatus& status, double tend, double T, double P, VectorXd& n);
	
	void
	ReactStep(KineticStatus& status, double tend, GeoSystem& geosystem);
	
	void
	React(double tbegin, double tend, double T, double P, VectorXd& n);
	
	void
	React(double tbegin, double tend, GeoSystem& geosystem);
	
private:
	/// The cannonical system instance
	CannonicalSystem cannonical_system;
	
	/// The kinetic solver instance
	KineticSolver kinetic_solver;
	
	/// The ode algorithm used for the calculation
	string algorithm;
};

#endif /* GEOREACTOR_H_ */
